#!/bin/sh

echo -n Try to bring eth0 interface up......>/dev/ttySAC0

if [ -f /etc/eth0-setting ] ; then
	source /etc/eth0-setting

	if grep -q " / nfs " /etc/mtab ; then
		echo -n NFS root ... > /dev/ttySAC0
	else
		DEV_ADDR=`cat /sys/class/net/eth0/address`
		if [ "$DEV_ADDR" = "00:00:00:00:00:00" ]; then
			ifconfig eth0 down
			ifconfig eth0 hw ether $MAC
		fi

		ifconfig eth0 $IP netmask $Mask up
		route add default gw $Gateway
	fi

	echo nameserver $DNS > /etc/resolv.conf
else

	if grep -q " / nfs " /etc/mtab ; then
		echo -n NFS root ... > /dev/ttySAC0
	else
		/sbin/ifconfig eth0 192.168.1.230 netmask 255.255.255.0 up
	fi
fi

echo Done > /dev/ttySAC0
